home *** CD-ROM | disk | FTP | other *** search
- /* ---------------------------------------------
- dollars.c When a dollar sign is typed, type
- another one and then a left arrow.
-
- THINK C "Set Project Type..." settings:
- code resource, type 'OAPe', ID 1001,
- custom header, preloaded and locked,
- file type 'rsrc', file creator 'RSED'.
- ---------------------------------------------
- */
- void main( EventRecord *evt );
-
- #define LEFT_ARROW_MESSAGE 0x00027B1CL
-
- void main( EventRecord *event )
- {
- EvQEl *event_q_data;
-
- /*
- In this case we have to be careful to avoid
- causing an infinite loop, so we post an
- abnormal dollar message, with no key code.
- */
-
- if ( (event->what == keyDown) &&
- ((event->message & charCodeMask) == '$') &&
- (event->message != '$') )
- {
- PostEvent( keyDown, '$' );
- PPostEvent( keyDown, LEFT_ARROW_MESSAGE,
- &event_q_data );
- event_q_data->evtQModifiers = 0;
- }
- }
-